<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri ="http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<head>
<head>
<meta http-equiv="Content-Type" content="text/jsp; charset=utf-8" />
<link rel="stylesheet" href="../statics/layui/css/layui.css" type="text/css" />
<link type="text/css" rel="stylesheet" href="../statics/css/style.css" />
<!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
<script src="../statics/layui/layui.all.js" type="text/javascript"></script>
<script type="text/javascript" src="../statics/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../statics/js/menu.js"></script>
<script type="text/javascript" src="../statics/js/select.js"></script>


<title>易买网</title>
</head>
<body>
	<!--Begin Header Begin-->
	<div class="soubg">
		<div class="sou">
			<!--Begin 所在收货地区 Begin-->
			<span class="s_city_b"> <span class="fl">送货至：</span> <span
				class="s_city"> <span>四川</span>
					<div class="s_city_bg">
						<div class="s_city_t"></div>
						<div class="s_city_c">
							<h2>请选择所在的收货地区</h2>
							<table border="0" class="c_tab"
								style="width:235px; margin-top:10px;" cellspacing="0"
								cellpadding="0">
								<tr>
									<th>A</th>
									<td class="c_h"><span>安徽</span><span>澳门</span></td>
								</tr>
								<tr>
									<th>B</th>
									<td class="c_h"><span>北京</span></td>
								</tr>
								<tr>
									<th>C</th>
									<td class="c_h"><span>重庆</span></td>
								</tr>
								<tr>
									<th>F</th>
									<td class="c_h"><span>福建</span></td>
								</tr>
								<tr>
									<th>G</th>
									<td class="c_h"><span>广东</span><span>广西</span><span>贵州</span><span>甘肃</span></td>
								</tr>
								<tr>
									<th>H</th>
									<td class="c_h"><span>河北</span><span>河南</span><span>黑龙江</span><span>海南</span><span>湖北</span><span>湖南</span></td>
								</tr>
								<tr>
									<th>J</th>
									<td class="c_h"><span>江苏</span><span>吉林</span><span>江西</span></td>
								</tr>
								<tr>
									<th>L</th>
									<td class="c_h"><span>辽宁</span></td>
								</tr>
								<tr>
									<th>N</th>
									<td class="c_h"><span>内蒙古</span><span>宁夏</span></td>
								</tr>
								<tr>
									<th>Q</th>
									<td class="c_h"><span>青海</span></td>
								</tr>
								<tr>
									<th>S</th>
									<td class="c_h"><span>上海</span><span>山东</span><span>山西</span><span
										class="c_check">四川</span><span>陕西</span></td>
								</tr>
								<tr>
									<th>T</th>
									<td class="c_h"><span>台湾</span><span>天津</span></td>
								</tr>
								<tr>
									<th>X</th>
									<td class="c_h"><span>西藏</span><span>香港</span><span>新疆</span></td>
								</tr>
								<tr>
									<th>Y</th>
									<td class="c_h"><span>云南</span></td>
								</tr>
								<tr>
									<th>Z</th>
									<td class="c_h"><span>浙江</span></td>
								</tr>
							</table>
						</div>
					</div>
			</span>
			</span>
			<!--End 所在收货地区 End-->
			<span class="fr">
			<c:if test="${user2==null}">
        		<span class="fl"><span id="userName">你好，请<a href="${pageContext.request.contextPath}/pre/Login.jsp">登录</a></span>&nbsp; <a href="${pageContext.request.contextPath}/pre/Regist.jsp" style="color:#ff4e00;">免费注册</a>&nbsp;|&nbsp;<a href="#">我的订单</a>&nbsp;|</span>
        	</c:if>
        	<c:if test="${user2!=null}">
        	
        		<c:if test="${loginname2=='admin'}">
        			<span class="fl">
        				<a href="javascript:;">${user2}</a>&nbsp;
        				<a href="javascript:;" id="zhuxiao">注销</a></span>&nbsp;
        				<a href="${pageContext.request.contextPath}/pre/Member_User_Info.jsp" style="color:#ff4e00;">后台管理</a>&nbsp;|&nbsp;
        				<a href="../pre/order?action=index&userId=${sessionScope.loginUser.id}">我的订单</a>
        			</span>
        		</c:if>
        		
        		<c:if test="${loginname2!='admin'}">
        			<span class="fl">
        					<a href="${pageContext.request.contextPath}/pre/Member_User_Info.jsp">${user2}</a>&nbsp;
        					<a href="javascript:;" id="zhuxiao">注销</a></span>&nbsp;
        					<a href="${pageContext.request.contextPath}/pre/Regist.jsp" style="color:#ff4e00;">免费注册</a>&nbsp;|&nbsp;
        					<a href="../pre/order?action=index&userId=${sessionScope.loginUser.id}">我的订单</a>
        			</span>
        		</c:if>
            </c:if>
			
			</span>
		</div>
	</div>
	<div class="m_top_bg">
		<div class="top">
			<div class="m_logo">
				<a href="${pageContext.request.contextPath}/pre/index.jsp"><img src="../statics/images/logo3.png" /></a>
			</div>
			<div class="m_search">
				<form>
					<input type="text" value="" class="m_ipt" /> <input type="submit"
						value="搜索" class="m_btn" />
				</form>
				<span class="fl"><a href="#">咖啡</a><a href="#">iphone 6S</a><a
					href="#">新鲜美食</a><a href="#">蛋糕</a><a href="#">日用品</a><a href="#">连衣裙</a></span>
			</div>
			<div class="i_car">
				<div class="car_t">
					购物车 [ <span>3</span> ]
				</div>
				<div class="car_bg">
					<!--Begin 购物车未登录 Begin-->
					<div class="un_login">
						还未登录！<a href="Login.jsp" style="color:#ff4e00;">马上登录</a> 查看购物车！
					</div>
					<!--End 购物车未登录 End-->
					<!--Begin 购物车已登录 Begin-->
					<ul class="cars">
						<li>
							<div class="img">
								<a href="#"><img src="../statics/images/car1.jpg" width="58"
									height="58" /></a>
							</div>
							<div class="name">
								<a href="#">法颂浪漫梦境50ML 香水女士持久清新淡香 送2ML小样3只</a>
							</div>
							<div class="price">
								<font color="#ff4e00">￥399</font> X1
							</div>
						</li>
						<li>
							<div class="img">
								<a href="#"><img src="../statics/images/car2.jpg" width="58"
									height="58" /></a>
							</div>
							<div class="name">
								<a href="#">香奈儿（Chanel）邂逅活力淡香水50ml</a>
							</div>
							<div class="price">
								<font color="#ff4e00">￥399</font> X1
							</div>
						</li>
						<li>
							<div class="img">
								<a href="#"><img src="../statics/images/car2.jpg" width="58"
									height="58" /></a>
							</div>
							<div class="name">
								<a href="#">香奈儿（Chanel）邂逅活力淡香水50ml</a>
							</div>
							<div class="price">
								<font color="#ff4e00">￥399</font> X1
							</div>
						</li>
					</ul>
					<div class="price_sum">
						共计&nbsp; <font color="#ff4e00">￥</font><span>1058</span>
					</div>
					<div class="price_a">
						<a href="#">去购物车结算</a>
					</div>
					<!--End 购物车已登录 End-->
				</div>
			</div>
		</div>
	</div>
	<!--End Header End-->
	<div class="i_bg bg_color">
		<!--Begin 用户中心 Begin -->
		<div class="m_content">
			<div class="m_left">
				<div class="left_n">管理中心</div>
				<div class="left_m">
					<div class="left_m_t t_bg1">订单中心</div>
					<ul>
						<li><a
							href="${pageContext.request.contextPath}/pre/Member_Order.jsp">我的订单</a></li>
						<li>

						<li><a href="#">全部订单</a></li>
					</ul>
				</div>
				<c:if test="${loginname2=='admin'}">
				<div class="left_m">
					<div class="left_m_t t_bg2">会员中心</div>
					<ul>
						<li><a href="${pageContext.request.contextPath}/pre/Member_User_Info.jsp">用户信息</a></li>
						<!-- 
                    <li><a href="Member_Collect.jsp">我的收藏</a></li>
                    <li><a href="Member_Msg.jsp">我的留言</a></li>
                    <li><a href="Member_Links.jsp">推广链接</a></li>
                    <li><a href="#">我的评论</a></li>
                     -->
						<li><a
							href="${pageContext.request.contextPath}/pre/Member_UserList.jsp">用户列表</a></li>

					</ul>
				</div>
				<div class="left_m">
					<div class="left_m_t t_bg3">商品管理</div>
					<ul>
						<li><a
							href="${pageContext.request.contextPath}/pre/Member_product_type.jsp">分类管理</a></li>
						<li><a
							href="${pageContext.request.contextPath}/pre/Member_product_rule.jsp">商品管理</a></li>
						<li><a
							href="${pageContext.request.contextPath}/pre/Member_product_add.jsp">商品上架</a></li>
					</ul>
				</div>
				<div class="left_m">
					<div class="left_m_t t_bg4">资讯中心</div>
					<ul>
						<li><a
							href="${pageContext.request.contextPath}/pre/Menber_NewList.jsp">资讯列表</a></li>
					</ul>
				</div>
				</c:if>
			</div>
			<div class="m_right">
				<p><h1>修改用户</h1></p>

				<div class="mem_t" align="right">
				</div>
				<form id="form">
					<table class="layui-table">
						<tr height="40">
							<td align="right">登录名 : </td>
							<td align="left"><input type="text" name="loginName" id="loginName"/></td>
						</tr>
						<tr height="40">
							<td align="right">用户名 : </td>
							<td align="left"><input type="text" name="userName" id="userNames"/></td>
						</tr>
						<tr height="40">
							<td align="right">密码 : </td>
							<td align="left"><input type="password" name="password" id="password"/></td>
						</tr>
						<tr id="sextypes">
							<td align="right">性别 : </td>
						</tr>
						<tr height="40">
							<td align="right">身份证号 : </td>
							<td align="left"><input type="text" name="identityCode" id="identityCode" value=""/></td>
						</tr>
						<tr height="40">
							<td align="right">邮箱 : </td>
							<td align="left"><input type="text" name="email" id="email"/></td>
						</tr>
						<tr height="40">
							<td align="right">电话 : </td>
							<td align="left"><input type="text" name="mobile" id="mobile"/></td>
						</tr>
						<tr height="40" id="userTypes">
							<td align="right">用户类型 :</td>
						</tr>
						<tr height="40">
							<td align="right"></td>
							<td align="left"><input type="button" class="layui-btn" name="updata" id="updata" value="修改"/>
						</tr>
					</table>
				</form>
				
			</div>
		</div>
		<!--End 用户中心 End-->
		<!--Begin Footer Begin -->
		<div class="b_btm_bg b_btm_c">
			<div class="b_btm">
				<table border="0"
					style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;"
					cellspacing="0" cellpadding="0">
					<tr>
						<td width="72"><img src="../statics/images/b1.png" width="62"
							height="62" /></td>
						<td><h2>正品保障</h2>正品行货 放心购买</td>

					</tr>
				</table>
				<table border="0"
					style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;"
					cellspacing="0" cellpadding="0">
					<tr>
						<td width="72"><img src="../statics/images/b2.png" width="62"
							height="62" /></td>
						<td><h2>满38包邮</h2>满38包邮 免运费</td>
					</tr>
				</table>
				<table border="0"
					style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;"
					cellspacing="0" cellpadding="0">
					<tr>
						<td width="72"><img src="../statics/images/b3.png" width="62"
							height="62" /></td>
						<td><h2>天天低价</h2>天天低价 畅选无忧</td>
					</tr>
				</table>
				<table border="0"
					style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;"
					cellspacing="0" cellpadding="0">
					<tr>
						<td width="72"><img src="../statics/images/b4.png" width="62"
							height="62" /></td>
						<td><h2>准时送达</h2>收货时间由你做主</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="b_nav">
			<dl>
				<dt>
					<a href="#">新手上路</a>
				</dt>
				<dd>
					<a href="#">售后流程</a>
				</dd>
				<dd>
					<a href="#">购物流程</a>
				</dd>
				<dd>
					<a href="#">订购方式</a>
				</dd>
				<dd>
					<a href="#">隐私声明</a>
				</dd>
				<dd>
					<a href="#">推荐分享说明</a>
				</dd>
			</dl>
			<dl>
				<dt>
					<a href="#">配送与支付</a>
				</dt>
				<dd>
					<a href="#">货到付款区域</a>
				</dd>
				<dd>
					<a href="#">配送支付查询</a>
				</dd>
				<dd>
					<a href="#">支付方式说明</a>
				</dd>
			</dl>
			<dl>
				<dt>
					<a href="#">会员中心</a>
				</dt>
				<dd>
					<a href="#">资金管理</a>
				</dd>
				<dd>
					<a href="#">我的收藏</a>
				</dd>
				<dd>
					<a href="#">我的订单</a>
				</dd>
			</dl>
			<dl>
				<dt>
					<a href="#">服务保证</a>
				</dt>
				<dd>
					<a href="#">退换货原则</a>
				</dd>
				<dd>
					<a href="#">售后服务保证</a>
				</dd>
				<dd>
					<a href="#">产品质量保证</a>
				</dd>
			</dl>
			<dl>
				<dt>
					<a href="#">联系我们</a>
				</dt>
				<dd>
					<a href="#">网站故障报告</a>
				</dd>
				<dd>
					<a href="#">购物咨询</a>
				</dd>
				<dd>
					<a href="#">投诉与建议</a>
				</dd>
			</dl>
			<div class="b_tel_bg">
				<a href="#" class="b_sh1">新浪微博</a> <a href="#" class="b_sh2">腾讯微博</a>
				<p>
					服务热线：<br /> <span>400-123-4567</span>
				</p>
			</div>
			<div class="b_er">
				<div class="b_er_c">
					<img src="../statics/images/er.gif" width="118" height="118" />
				</div>
				<img src="../statics/images/ss.png" />
			</div>
		</div>
		<div class="btmbg">
			<div class="btm">
				备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com Copyright © 2015-2018
				易买网商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
				<img src="../statics/images/b_1.gif" width="98" height="33" /><img
					src="../statics/images/b_2.gif" width="98" height="33" /><img
					src="../statics/images/b_3.gif" width="98" height="33" /><img
					src="../statics/images/b_4.gif" width="98" height="33" /><img
					src="../statics/images/b_5.gif" width="98" height="33" /><img
					src="../statics/images/b_6.gif" width="98" height="33" />
			</div>
		</div>
		<!--End Footer End -->
	</div>
	<script src="../statics/js/jquery-1.4.2.min.js" type="text/javascript"></script>
	<script src="../statics/layui/layui.all.js" type="text/javascript"></script>
	<script>
    	$(function(){
    		$("#zhuxiao").click(function(){//注销
				location.href="../UserServlet?opr=zhuxiao";
			});
			
			function select(){
				var username="${param.UserName}";
				var loginname="${param.LoginName}";
				var usersex="${param.UserSex}";
				var usertype="${param.UserType}";
				var useremail="${param.UserEmail}";
				var usermobile="${param.UserMobile}";
				var userpassword="${param.UserPassword}";
				var useridentityCode="${param.UserIdentityCode}";
				
				//alert("性别"+usersex);alert("用户类型"+usertype);
				$("#userNames").val(username);
				$("#loginName").val(loginname);
				$("#email").val(useremail);
				$("#mobile").val(usermobile);
				$("#password").val(userpassword);
				$("#identityCode").val(useridentityCode);
				
				if(usersex==1){
					$("#sextypes").append("<td align='left'>"
      				+"<input type='radio' name='sex' value='1' checked/>男"
     				+"<input type='radio' name='sex' value='0'/>女"
     				+"</td>");
				}else if(usersex==0){
					$("#sextypes").append(
					"<td align='left'>"
      				+"<input type='radio' name='sex' value='1'/>男"
     				+"<input type='radio' name='sex' value='0'  checked/>女"
     				+"</td>");
				}
				
				if(usertype==1){
					$("#userTypes").append("<td align='left'><select name='type'>"
					+"<option value='0'>用户</option>"
					+"<option value='1' selected>管理员</option>"
					+"</select></td>"
					);
				}else if(usertype==0){
					$("#userTypes").append("<td align='left'><select name='type'>"
					+"<option value='0' selected>用户</option>"
					+"<option value='1'>管理员</option>"
					+"</select></td>"
					);
				}
			}
			
			$("#updata").click(function(){
				var userid="${param.UserId}";
				var $data=$("#form").serialize();
				$.ajax({
					"url":"../UserServlet?opr=updata&id="+userid,
					"type":"post",
					"data":$data,
					"dataType":"json",
					"success":function(data){;
						if(data==true){
							layer.msg('修改成功!',{icon:1,time:2000},function(){});
							location.href="../pre/Member_UserList.jsp";
						}else{
							layer.msg('修改失败!',{icon:2,time:2000},function(){});
						}
					}
				});
			});
			
    	select();
    	});
	</script>
	
</body>
</jsp>
